package com.cfuture08.component.dwz;

public class DWZJson {
	private String statusCode;
	private String message;
	private String action;
	private String navTabId;
	private String forwardUrl;
	private String callbackType = "reloadTab";

	public DWZJson() {
	}

	public DWZJson(String statusCode, String message, String navTabId,
			String action, String forwardUrl, String callbackType) {
		if (statusCode == null) {
			statusCode = "200";
		} else {
			this.statusCode = statusCode;
		}
		if (message == null) {
			if ("200".equals(statusCode)) {
				message = "操作成功";
			} else if ("300".equals(statusCode)) {
				message = "操作失败";
			}
		} else {
			this.message = message;
		}
		this.navTabId = navTabId;
		this.action = action;
		this.forwardUrl = forwardUrl;

		this.callbackType = callbackType;
	}

	public String getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public String getForwardUrl() {
		return forwardUrl;
	}

	public void setForwardUrl(String forwardUrl) {
		this.forwardUrl = forwardUrl;
	}

	public String getCallbackType() {
		return callbackType;
	}

	public void setCallbackType(String callbackType) {
		this.callbackType = callbackType;
	}

	public String getNavTabId() {
		return navTabId;
	}

	public void setNavTabId(String navTabId) {
		this.navTabId = navTabId;
	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("{");
		sb.append("\"statusCode\":\"").append(this.statusCode).append("\",");
		sb.append("\"message\":\"").append(this.message).append("\",");
		sb.append("\"action\":\"").append(this.action).append("\",");
		sb.append("\"navTabId\":\"").append(this.navTabId).append("\",");
		sb.append("\"forwardUrl\":\"").append(this.forwardUrl).append("\",");
		sb.append("\"callbackType\":\"").append(this.callbackType).append("\"");
		sb.append("}");
		return sb.toString();
	}
}
